#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    vector<string> divideString(string s, int k, char fill) {
        vector<string> v1;
        v1.resize(s.size() / k + (s.size() % k != 0));
        for (int i = 0; i < s.size(); i += k)
        {
            for (int j = 0; j < k; j++)
            {
                if (i + j < s.size())
                {
                    v1[i / k].push_back(s[i + j]);
                }
                else
                {
                    break;
                }
            }
        }

        while (v1[v1.size() - 1].size() < k)
        {
            v1[v1.size() - 1].push_back(fill);
        }

        return v1;
    }
};